			<?php use_helper('Date') ?>
			<?php include_javascripts_for_form($requestForm) ?>
			<?php use_helper('jQuery') ?>
		<div id="sidebar" >	
			<?php include_component('location', 'sideboxInfoZone', array('vivienda'=>$vivienda)) ?>
			<?php include_component('location', 'sideboxSameZone', array('vivienda'=>$vivienda)) ?>
			<?php include_partial('global/suggestionsSidebar') ?>	
			<?php include_component('searcher', 'sideboxFavorites') ?>
			<?php include_component('searcher', 'sideboxVisited') ?>	
		</div>	
	
		<div id="main">		
<div id="breadcrumbs"><?php echo link_to('Accueil', '@homepage') ?> > <?php echo link_to('Location', '@searcher') ?> > <a href="<?php echo ViviendaAlquiler::slugify($vivienda->getZonasViviendas()->getMunicipio(), '_') ?>" ><?php echo $vivienda->getZonasViviendas()->getMunicipio() ?></a> > <a href="<?php echo ViviendaAlquiler::slugify($vivienda->getZona(), '_') ?>" ><?php echo $vivienda->getZona() ?></a> > <?php echo ucwords($vivienda->getSlug())." ".$vivienda->getAlias() ?></div>
		
			<div class="post">
			
				<?php if ($sf_user->hasFlash('refererComment')): ?>
				<p><a href="<?php echo $sf_request->getReferer()."#".$vivienda->getNombre() ?>"> < Rentrer &agrave; <?php echo ($sf_user->getFlash('refererComment'))  ?>
				</a>
				<?php endif; ?>
				<h1><?php echo ucwords($vivienda->getSlug())." ".$vivienda->getAlias() ?><span class="village"><span class="zone"><?php echo $vivienda->getZona().",</span> ".$vivienda->getZonasViviendas()->getMunicipio() ?></span></h1>
				</p>		
				
				<blockquote><p><?php echo $vivienda->getDesc_brev_fr() ?></p></blockquote>
				
				<p>
					<img height="75" width="100" src="/cache/<?php echo $vivienda->getNombre() ?>100x75-1.jpg" alt="" style="" />
				</p>
				<div style="clear: left; top: 0px; margin-left: 140px; margin-right:20px; margin-top: -90px;"><?php echo $vivienda->getDesc_pre_fr() ?></div>
				<p>
					<img height="75" width="100" src="/cache/<?php echo $vivienda->getNombre() ?>100x75-2.jpg" alt="" style="float: left; margin-top: 25px;" class=""/>
				</p>
				
				<div style="margin-left:145px; margin-right: 20px;"><?php echo nl2br($vivienda->getDesc_fr()) ?>
					<div style="text-align:right;margin-right:16px;">Jour d'arriv&eacute;e:  <?php echo $vivienda->getDiaSemanaCambio() ?></div>
										<p class="post-footer" id="post-footer-location">	
					<?php if($precioMinimo > 0): ?>
					<?php include_component('location', 'viviendaFeatures', array('vivienda'=>$vivienda, 'precioMinimo'=>$precioMinimo)) ?>
					<?php else: ?>
					<?php include_component('location', 'viviendaFeatures', array('vivienda'=>$vivienda)) ?>
					<?php endif; ?>
					</p>
				</div>
				<!-- AddThis Button BEGIN -->
<div style="margin-left:510px" class="addthis_toolbox addthis_default_style">
<a title="Envoyer a un ami" class="addthis_button_email"></a>
<a title="Sauvegarder dans les Favoris du navigateur" class="addthis_button_favorites"></a>
<a title="Imprimer" class="addthis_button_print"></a>
<span class="addthis_separator">|</span>
<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4bae1f8274544eec" class="addthis_button_expanded">Partager</a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4bae1f8274544eec"></script>
<!-- AddThis Button END -->

			</div>
		

<div class="tabs">
        <ul class="tabNavigation">
		<?php if(count($fotoPaths)>0): ?>
            <li><a class="fotosTab" href="#fotos">Photos</a></li>
		<?php endif; ?>
			<li><a class="localisationTab" href="#localisation">Localisation</a></li>
		
			<li><a class="datesprixTab" href="#datesprix">Dates<?php if (count($prices)>0): ?> et prix<?php endif; ?></a></li>
		
			<li><a class="contacterTab" href="#contacter">Contacter / R&eacute;server</a></li>
        </ul>
		<?php if(count($fotoPaths)>0): ?>
        <div id="fotos">
            <p>
			<!-- Start Advanced Gallery Html Containers -->
				<div id="gallery" class="content" style="width:405px;margin-bottom:40px;">
					<div id="controls" class="controls"></div>
					<div id="loading" class="loader"></div>
					<div id="slideshow" class="slideshow"></div>
					<div id="caption" class="embox"></div>
				</div>

				<div id="thumbs" class="navigation" >
					<ul class="thumbs noscript">
						<?php $offset=1;$aux=0; for($i=0;$i<count($arrFiles);$i++) : ?>
						<li>
					
							<a class="thumb" href="<?php echo (sfConfig::get('app_static_domain_cache').$vivienda->getNombre()."/".$arrFiles[$i+1]) ?>" title="<?php echo $fotoComments[$fotoComments[$aux]['numero']-$offset]['fr_comment'] ?>">
								<img src="/cache/<?php echo $vivienda->getNombre() ?>100x75-<?php echo $i+1 ?>.jpg" alt="" />
							</a>
							<div class="caption">
								<div class="image-title"><?php echo ucwords($vivienda->getSlug())." ".$vivienda->getAlias() ?></div>
								<div class="image-desc">
								<?php
								$number=explode(".", $arrFiles[$i+1]);
								if($number[0] != $fotoComments[$aux]['numero']){
									
								$aux--;
								$offset++;
								}
								else{
									echo $fotoComments[$fotoComments[$aux]['numero']-$offset]['es_comment'] ;
								}
								$aux++;
								?>
								</div>
							</div>
						</li>
						<?php endfor; ?>	
					</ul>
				</div>
				<!-- End Advanced Gallery Html Containers -->
				</p>
		</div>
		<?php endif; ?>
		
        <div id="localisation">
            <p><div id="map"></div></p>
        </div>
		
        <div id="datesprix">
            <p><h3>Dates</h3>
					
			<?php include_component('location', 'calendarVivienda', array('nombreVivienda'=>$vivienda->getNombre())) ?>
			
				<div>
					<?php if (count($prices)>0): ?>
						<h3>Prix par semaine</h3>
						<table class="prices">
						<tr>
							<th class="first">Dates comprises</th>
							<th>Prix</th>
						</tr>
						<?php foreach ($prices as $price){ ?>
						<tr class="row-a">
							<td class="first"><?php echo format_date($price->getFecha_Inicio(), 'dd MMM') ?> - <?php echo format_date($price->getFecha_Fin(), 'dd MMM') ?></td>
							<td>
							<?php if($price->getDescuento() > 0): ?>
								<span class="discount_old_price"><?php echo $price->getPrecio_euros() + sfConfig::get('app_comision_euros'); ?>&#8364;</span> <span class="discount_new_price"><?php echo $price->getDescuento() + sfConfig::get('app_comision_euros'); ?>&#8364;</span>
							<?php else: ?>
								<?php echo $price->getPrecio_euros() + sfConfig::get('app_comision_euros'); ?>&#8364;
							<?php endif; ?>
							
							</td>
						</tr>
						<?php } ?>
						</table>
					<?php endif; ?>
		</div>	
		<div class="calenderLegende">
			<span class="calenderPasDisponible">&nbsp;&nbsp;&nbsp;&nbsp;</span>Pas disponible
		</div>
		</p>
		</div>
		
        <div id="contacter">
            <p>		<div class="formContainer">
			
				<h3>Demander des renseignements ou initier votre petition de r&eacute;servation</h3>

<?php echo jq_form_remote_tag(array(
    'update'   => 'requestForm',
    'url'      => 'home/send',
	'script' => true,
	'loading'  => "$('.ajaxLoading').show()",
	'complete' => 'jQuery(function() {
				jQuery("#recepcion_emails_datainici").datepicker({showOn: "button", buttonImage: "/images/calendar.png", buttonImageOnly: true, dateFormat: "dd-mm-yy", numberOfMonths: 3, buttonText: "Selectionner la date",
					showButtonPanel: true, firstDay: 1, stepMonths: 3,
				});				
				jQuery("#recepcion_emails_datafin").datepicker({beforeShow: customRange, showOn: "button", buttonImage: "/images/calendar.png", buttonImageOnly: true, dateFormat: "dd-mm-yy", numberOfMonths: 3, buttonText: "Selectionner la date",
					showButtonPanel: true, firstDay: 1, stepMonths: 3,
				});	
				jQuery.datepicker.setDefaults(jQuery.datepicker.regional["fr"]);
			});
			function customRange(input) {
				var min = $("#recepcion_emails_datainici").val();
				var format = $("#recepcion_emails_datainici").datepicker("option", "dateFormat");
				$(input).datepicker("option", "minDate",
				$.datepicker.parseDate(format, min));
			};',
)) ?>
<div id="requestForm">
<div style="clear:left;"><?php echo $requestForm['email']->renderRow() ?></div>
<div style="float:left; margin-right: 20px;"><?php echo $requestForm['datainici']->renderRow() ?></div>
<div style="float:left;"><?php echo $requestForm['datafin']->renderRow() ?></div>
<div style="clear:left;"><?php echo $requestForm['mensaje']->renderRow() ?></div>
<?php echo $requestForm['idioma']->render(array('value' => 'fr')) ?>
<?php echo $requestForm['vivienda']->render(array('value' => $vivienda->getNombre())) ?>
<?php echo $requestForm['fechahorarecepcion']->render() ?>
<?php echo $requestForm['ip']->render(array('value' => $sf_request->getHttpHeader('addr','remote'))) ?>
<?php echo $requestForm['casasvisitadas']->render(array('value' => $sf_user->getVisitedString())) ?>
<?php echo $requestForm['_csrf_token'] ?>
<input type="submit" value="Envoyer" name="commit" id="contacterSubmit"/><span class="ajaxLoading">...veuillez patienter...</span>
		
</div>
</form>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script src="http://maps.google.com/maps?file=api&v=1&key=<?php echo sfConfig::get('app_googlemaps_key') ?>" type="text/javascript"></script> 
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4bae07182e19cd2e"></script>
<script type="text/javascript">
			var addthis_config = {ui_language: "fr", ui_cobrand: "Costa Brava's", services_expanded: 'linkedin,digg,delicious,twitter,google,facebook,live,buzz,reddit,more'}
			jQuery(function() {
				jQuery("#recepcion_emails_datainici").datepicker({showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: 'dd-mm-yy', numberOfMonths: 3, buttonText: 'Selectionner la date',
					showButtonPanel: true, firstDay: 1, stepMonths: 3,
				});				
				jQuery("#recepcion_emails_datafin").datepicker({beforeShow: customRange, showOn: 'button', buttonImage: '/images/calendar.png', buttonImageOnly: true, dateFormat: 'dd-mm-yy', numberOfMonths: 3, buttonText: 'Selectionner la date',
					showButtonPanel: true, firstDay: 1, stepMonths: 3,
				});	
				jQuery.datepicker.setDefaults(jQuery.datepicker.regional["fr"]);
			});
			function customRange(input) {
				var min = $("#recepcion_emails_datainici").val();
				var format = $("#recepcion_emails_datainici").datepicker('option', 'dateFormat');
				$(input).datepicker('option', 'minDate',
				$.datepicker.parseDate(format, min));
			};
			var map = new GMap(document.getElementById("map")); 
			map.setMapType(G_SATELLITE_MAP); 
			map.removeMapType(G_HYBRID_MAP);				
								
			map.addControl(new GLargeMapControl()); 
			map.addControl(new GMapTypeControl()); 
			map.centerAndZoom(new GPoint (<?php echo $vivienda->getGeoLongitud() ?>, <?php echo $vivienda->getGeoLatitud() ?>), 3);
			
			var point = new GLatLng(<?php echo $vivienda->getGeoLatitud() ?>, <?php echo $vivienda->getGeoLongitud() ?>);
			var marker = new GMarker(point);
			var gmText = '<div style="float:left;margin-right:3px;"><h4><?php echo ucwords($vivienda->getSlug())." ".$vivienda->getAlias() ?></h4><div><?php echo $vivienda->getZona().", ".$vivienda->getZonasViviendas()->getMunicipio() ?></div><div>Dorment <?php echo $vivienda->getCapacidad() ?> personnes</div></div><img height="55" width="75" src="/cache/<?php echo $vivienda->getNombre() ?>100x75-1.jpg" alt="" style="style="float: right; border:1px solid;/>';
			GEvent.addListener(marker, "click", function() { 
				marker.openInfoWindowHtml(gmText);
			});
            map.addOverlay(marker);	
			marker.openInfoWindowHtml(gmText);

		google.load("language", "1");	
		function translate($element) {
			google.language.translate($element.html(), "es", "fr", function(result) {
			  if (!result.error) {
				$element.replaceWith(result.translation) ;
			  }
			});
		}

		$(document).ready(function(){ 
			$('.image-desc[text!=""]').each(function(index){
				if(jQuery.trim($(this).html()) != ''){
					translate($(this));
				}
			});
		}); 
		</script>
			</div></p>
        </div>
		<?php if ($sf_user->hasFlash('refererComment')): ?>
				<p class="rentrerRecherche"><a href="<?php echo $sf_request->getReferer()."#".$vivienda->getNombre() ?>"> < Rentrer &aacute; <?php echo ($sf_user->getFlash('refererComment'))  ?>
				</a></p>
		<?php endif; ?>
</div>

				<div style="clear:both;">
					
				</div>
</div>